package homework;

import java.util.Scanner;
public class Demo01 {

    public static int sum(int num1, int num2) {
        return num1 + num2;
    }

    public static double sum(double num1, double num2) {
        return num1 + num2;
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);

        // 提示用户输入第一个数据
        System.out.print("请输入第一个数据：");
        int num1 = scanner.nextInt();

        // 提示用户输入第二个数据
        System.out.print("请输入第二个数据：");
        int num2 = scanner.nextInt();

        // 计算两个数据之和
        int sum1 = sum(num1, num2);
        double sum2 = sum((double) num1, (double) num2);

        // 输出结果
        System.out.println("两个整数的和为：" + sum1);
        System.out.println("两个小数的和为：" + sum2);
    }
}